#include "GameOpt.h"


Entity::Entity(const char inToken, Point & DesPoint,
			   unsigned int MaxMovement, unsigned int MaxHealth, 
			   unsigned int Defense, unsigned int Power,
			   unsigned int Movement, unsigned int Health)
			   :cToken(inToken),Pos(DesPoint),
			   uiMaxMovement(MaxMovement),uiMaxHealth(MaxHealth),
			   uiDefense(Defense),uiPower(Power),
			   uiMovement(Movement),uiHealth(Health)

{
}

Entity::~Entity()	//nothing to delete
{
}

bool Entity::setPower(unsigned int Power)
{
	uiPower = Power;
	return true;
}

unsigned int Entity::getPower() const
{
	return uiPower;
}

bool Entity::setDefense(unsigned int Defense)
{
	uiDefense = Defense;
	return true;
}

unsigned int Entity::getDefense() const
{
	return uiDefense;
}

bool Entity::setHealth(unsigned int Health)
{
	uiHealth = Health;
	return true;
}

unsigned int Entity::getHealth() const
{
	return uiHealth;
}

bool Entity::setMaxHealth(unsigned int Health)
{
	uiMaxHealth = Health;
	return true;
}

unsigned int Entity::getMaxHealth() const
{
	return uiMaxHealth;
}

bool Entity::incHealth(unsigned int Health) //inc health up to the maximum health allowed
{
	if(uiHealth+Health>uiMaxHealth)
		uiHealth=uiMaxHealth;
	else
		uiHealth+=Health;
	return true;
}


bool Entity::setMovement(unsigned int Movement)
{
	uiMovement = Movement;
	return true;
}

bool Entity::decMovement()
{
	if(uiMovement==0)
		return false;
	return setMovement(uiMovement-1);
}

bool Entity::resetMovement()
{
	return setMovement(uiMaxMovement);
}

unsigned int Entity::getMovement() const 
{
	return uiMovement;
}

bool Entity::setMaxMovement(unsigned int Movement)
{
	uiMaxMovement = Movement;
	return true;
}

unsigned int Entity::getMaxMovement()const 
{
	return uiMaxMovement;
}


bool Entity::setPos(const Point DesPoint)
{
	Pos=DesPoint;
	return true;
}
bool Entity::setPos(const unsigned int xDes,const unsigned int yDes)
{
	Pos(xDes,yDes);
	return true;
}

char Entity::getcToken() const
{
	return cToken;
}

Point Entity::getPos() const
{
	return Pos;
}

bool Entity::isActive() const
{
	return(uiHealth<=0);
}
